function add(a,b) {
    return a + b
}

var addOne = partial(add,1)
addOne(2)  // 3
console.log(addOne(2));

function partial(fn) {
    var agrs = [].slice.call(arguments,1)
    console.log(arguments);
    return function() {
        var newArgs = agrs.concat([].slice.call(arguments))
        return fn.apply(this,newArgs)
    }
}